import Vue from 'vue'
import App from './App.vue'
import router from './router'
import store from './store'
import axios from 'axios'
import moment from 'moment' //时间处理工具
import 'lib-flexible/flexible' //rem自适应工具
import VueClipboard from 'vue-clipboard2' //复制工具
// 按需引入vant组件
import { Cell, Sticky, Rate, Col, Row, NavBar, Image, Icon, Tab, Tabs, PullRefresh, Form, Field, Button, Tabbar, TabbarItem, Swipe, SwipeItem, List, Toast, Card, Step, Steps, Dialog, ShareSheet, Popup, Uploader } from 'vant'

// 引入全局组件
import MyHeader from '@/components/MyHeader.vue'
import MyFooter from '@/components/MyFooter.vue'
import MyForm from '@/components/Form.vue'
import MyCustom from '@/components/MyCustom.vue'
import MyRecommend from '@/components/MyRecommend.vue'

// 使用复制工具
Vue.use(VueClipboard)

// 使用vant组件
Vue.use(Icon)
  .use(Tab)
  .use(Tabs)
  .use(PullRefresh)
  .use(Form)
  .use(Field)
  .use(Button)
  .use(Tabbar)
  .use(TabbarItem)
  .use(Swipe)
  .use(SwipeItem)
  .use(NavBar)
  .use(Image)
  .use(Col)
  .use(Row)
  .use(List)
  .use(Rate)
  .use(Sticky)
  .use(PullRefresh)
  .use(Cell)
  .use(Toast)
  .use(Card)
  .use(Step)
  .use(Steps)
  .use(Dialog)
  .use(ShareSheet)
  .use(Popup)
  .use(Uploader)

// 注册全局组件
Vue.component('my-footer', MyFooter)
Vue.component('my-header', MyHeader)
Vue.component('my-form', MyForm)
Vue.component('my-custom', MyCustom)
Vue.component('my-recommend', MyRecommend)

//axios基础路径
axios.defaults.baseURL = '/api'

Vue.config.productionTip = false
Vue.prototype.axios = axios
Vue.prototype.moment = moment

new Vue({
  router,
  store,
  render: h => h(App)
}).$mount('#app')
